<!--
 * @Author: 詹真琦(legendryztachi@gmail.com)
 * @Date: 2022-06-13 10:33:33
 * @LastEditors: 代琪 1529992814@qq.com
 * @LastEditTime: 2022-06-20 10:21:35
 * @FilePath: \code\ctp-static-portal-front\src\components\login\loginSection.vue
 * @Description: 
-->
<template>
  <iframe :src="iframeSrc" :height="height" :width="contentWidth" frameBorder="0"></iframe>
</template>

<script>
  import { methods } from '@/utils';
  export default {
    name: 'LoginSection',
    props: {
      sectionData: { type: Object },
      contentWidth: { type: Number },
      sectionThemeData: { type: Object },
    },
    data() {
      return {
        height: methods.getContentHeight(this.sectionData.options),
      };
    },
    computed: {
      iframeSrc() {
        let tempSrc = urlPreStr + '/main.do?method=index&&loginFrom=loginPortal&topValue=21';
        let options = this.sectionData
          ? this.sectionData.options
          : this.sectionThemeData.loginPreBtnTheme;
        let bg = options.backgroundColor || options.loginboxmainbgc;
        tempSrc =
          options && options.rowList
            ? `${tempSrc}&rowList=${encodeURIComponent(options.rowList)}`
            : tempSrc;
        tempSrc =
          options && options.loginboxbuttonbgc
            ? `${tempSrc}&btnbgc=${encodeURIComponent(options.loginboxbuttonbgc)}`
            : tempSrc;
        tempSrc =
          options && options.loginboxbottombgc
            ? `${tempSrc}&btombgc=${encodeURIComponent(options.loginboxbottombgc)}`
            : tempSrc;
        tempSrc = options && bg ? `${tempSrc}&bgc=${encodeURIComponent(bg)}` : tempSrc;
        return tempSrc;
      },
    },
  };
</script>
